/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.baatar.opt.pga.impl.service;

/**
 *
 * @author Ba
 */
public class Optimizer<M> {
    private int clusterIndex = 0;
    private int optimizerIndex = 0;
    private StringBuilder convergenceInfo = null;
//    private MigrantChromosome<M> lastMigrant = null;

    public Optimizer(int clusterIndex, int optimizerIndex) {
        this.clusterIndex = clusterIndex;
        this.optimizerIndex = optimizerIndex;
        this.convergenceInfo = new StringBuilder();
    }

    public void addConvergenceInfo(int iteration, String convergenceInfo) {
        this.convergenceInfo.append("\n\r(")
                            .append(clusterIndex)
                            .append(",")
                            .append(optimizerIndex)
                            .append("): ")
                            .append(iteration)
                            .append("-")
                            .append(convergenceInfo);
    }

    public StringBuilder getConvergenceInfo() {
        return convergenceInfo;
    }

//    /**
//     * @return the lastMigrant
//     */
//    public MigrantChromosome<M> getLastMigrant() {
//        return lastMigrant;
//    }
//
//    /**
//     * @param lastMigrant the lastMigrant to set
//     */
//    public void setLastMigrant(MigrantChromosome<M> lastMigrant) {
//        this.lastMigrant = lastMigrant;
//    }
}
